# -*- coding: utf-8 -*-
import sys
from uimanager import UIManager

try:
    import pygtk
    pygtk.require("2.0")
    import gtk
    import gtk.glade    
except ImportError,cause:
    sys.stderr.write("ImportError: Module is not present %s" % cause)
    sys.exit(1)

class AboutWindow():
    def __init__(self,main_window):
        # the main window is needed
        self.main_window = main_window

        # get the widgets and set
        self.uimanager = UIManager("about_window")
        self.window = self.uimanager.widget("about_window")
        self.window.set_title("Sobre")

        # add the signal for close
        self.uimanager.add_signal({
            "close_about_window":self.close_about_window
        })

        # connect ths signals
        self.uimanager.signals_connect()

    def show_about_window(self):
        # set the parent and show
        self.window.set_transient_for(self.main_window)
        response = self.window.show()
            
    def close_about_window(self,*args):
        # hide the window
        self.window.hide()
